﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ctrl="clr-namespace:Tum.PDE.LanguageDSL.Visualization.View.Controls"
                    xmlns:vm="clr-namespace:Tum.PDE.LanguageDSL.Visualization.ViewModel.Diagram">

    <DataTemplate DataType="{x:Type vm:SpecificElementsDiagramViewModel}" x:Key="SpecificElementsDiagramTemplate">
        <ctrl:DesignerItem x:Name="DiagramClassElement" Margin="-1,0,-1,0" HorizontalAlignment="Left">
            <Grid>
                <StackPanel Orientation="Horizontal">
                    <StackPanel>
                        <Border Margin="-1" Name="BdSelected" BorderBrush="Transparent" BorderThickness="1.2" Padding="1" SnapsToDevicePixels="True">
                            <Border Name="Bd" Margin="0" BorderBrush="#FF5D5A55" BorderThickness="0.6,0" Padding="0" SnapsToDevicePixels="True">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="White" Offset="0"/>
                                        <GradientStop Color="#22E2DBDB" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Expander IsExpanded="{Binding Path=IsExpanded}" ExpandDirection="Right">
                                    <Expander.Header>
                                        <TextBlock x:Name="DecoratorElementName" FontWeight="SemiBold" FontFamily="Tahoma" FontSize="9pt" Margin="5,0,5,0" Grid.Column="1" Text="{Binding Path=DiagramTitle, Mode=OneWay}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                    </Expander.Header>
                                    <StackPanel MinHeight="600" MinWidth="300" Margin="0,0,0,100" Orientation="Vertical">
                                        <Grid Margin="5">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="24"></RowDefinition>
                                                <RowDefinition Height="*"></RowDefinition>
                                                <RowDefinition Height="3"></RowDefinition>
                                                
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Referenced Domain Classes: " Grid.Row="0" VerticalAlignment="Center"/>

                                            <ListBox x:Name="LstView" ItemsSource="{Binding Path=ReferenceVMs, Mode=OneWay}" Grid.Row="1" BorderBrush="Transparent"
                                                      FocusVisualStyle="{x:Null}">
                                                <ListBox.ItemContainerStyle>
                                                    <Style TargetType="{x:Type ListBoxItem}">
                                                        <Setter Property="BorderBrush" Value="Transparent"/>
                                                        <Setter Property="Background" Value="Transparent" />
                                                        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="ListBoxItem">
                                                                    <Border Name="Border" BorderBrush="Transparent">
                                                                        <ContentPresenter/>
                                                                    </Border>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                </ListBox.ItemContainerStyle>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <Grid Margin="5" Height="24">
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="24"/>
                                                                <ColumnDefinition Width="Auto"/>
                                                                <ColumnDefinition Width="24"/>
                                                            </Grid.ColumnDefinitions>

                                                            <Image Source="/Tum.PDE.LanguageDSL.Visualization;component/Resources/Images/Class_16.png" Grid.Column="0" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                            <TextBlock Text="{Binding Path=DomainElementName, Mode=OneWay}" Grid.Column="1" VerticalAlignment="Center" FontSize="12"/>
                                                            <Button Grid.Column="2" Width="24" Height="24" BorderBrush="Transparent" BorderThickness="0" Focusable="False" Command="{Binding Path=DataContext.DeleteCommand, ElementName=LstView}" CommandParameter="{Binding Path=.}" Background="Transparent">
                                                                <Image Source="/Tum.PDE.LanguageDSL.Visualization;component/Resources/Images/Delete-16.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                            </Button>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>


                                            <Border Grid.Row="2" Height="1" BorderThickness="1" BorderBrush="LightGray"/>
                                        </Grid>
                                        
                                        
                                    </StackPanel>
                                </Expander>
                            </Border>
                        </Border>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </ctrl:DesignerItem>
    </DataTemplate>
</ResourceDictionary>